class CreateOrderItems < ActiveRecord::Migration[5.2]
  def change
    create_table :order_items do |t|
      t.integer :order_id
      t.integer :user_id
      t.integer :spu_id
      t.integer :sku_id
      t.integer :quantity, default: 0
      t.boolean :on_cart,  default: true
      t.string :spu_name
      t.string :option_value_presentation
      t.decimal :fee, :precision => 10, :scale => 2, :default => 0.0
      t.boolean :is_evaluated, default: false
      t.integer :state, default: 0
      t.integer :after_sale_type
      t.integer :refund_reason_id
      t.decimal :refund_fee, :precision => 10, :scale => 2, :default => 0.0
      t.string :refund_remark
      t.datetime :refund_at, :default => "now()"
      

      t.timestamps
    end
  end
end
